<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.io.*"%>
<%@ page import="xml.response.*"%>
<%@ page import="xml.root"%>
<%@ page import="util.print.printLogCat"%>
<%@ page import="org.sql.table.*"%>
<%@ page import="xml.var"%>
<%@ page import="java.util.Vector"%>
<%@ page import="java.util.Enumeration"%>
<%@ page import="jqgrid.jqgrid"%>
<%@ page import="org.util.getNewData"%>
<%@ page import="requestInterFace.Handle.*"%>
<%@ page import="org.util.SerialNumberUtil"%>
<%@ include file="../../util/paramPrint.jsp" %>
<%@ page trimDirectiveWhitespaces="true" %> 
<%
String Product_Type = request.getParameter("Product_Type");
String Info =request.getParameter("Info");//产品描述
String userType=(String)session.getAttribute("User_Type");
root root=new root();
if(userType==null||!userType.equals("1")){
root.setStatus("false");
root.setMsg("权限不够");
PrintWriter pw = response.getWriter();
pw.println(root.getXmlString());
pw.flush();
return ;
}

 		if(Product_Type==null||Product_Type.equals("")){
		root.setStatus("false");
		root.setMsg("请填写正确产品类型");
		PrintWriter pw = response.getWriter();
		pw.println(root.getXmlString());
		pw.flush();
		return ;
		}
		
		productTypeHandle handle=new productTypeHandle();
		if(handle.isHaveProduct_Type(Product_Type)){
			root.setStatus("false");
			root.setMsg("记录已经存在");
			PrintWriter pw = response.getWriter();
			pw.println(root.getXmlString());
			pw.flush();
			return ;
		}
		producttypeinfo1_1 user=new producttypeinfo1_1();

		if(Product_Type!=null&&(!Product_Type.equals(""))){
		 user.setInsertField("Product_Type",Product_Type);
		}
		
		if(Info!=null&&!Info.equals("")){
		 user.setInsertField("Info",Info);
		}
		int row=user.insert();
		root.setRecords(""+row);//设置当前查询到的记录数
		if(row>0){
			root.setStatus("true");
			root.setMsg("添加成功");
		}
		//printLogCat.printlnWriter(root.getXmlString());
		String rep=root.getXmlString();
%>
<%=rep%>


